{% extends "front/Base.html" %}

{% block title %}
    <title>{{ g.user.username }}的借阅记录</title>
{% endblock %}

{% block body %}
    <div class="container-fluid center">
        <table class="table">
          <thead>
            <tr>
              <th scope="col">序号</th>
              <th scope="col">书名</th>
              <th scope="col">作者</th>
              <th scope="col">借阅日期</th>
              <th scope="col">状态</th>
            </tr>
          </thead>

          <tbody>
            {% for book in books %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ book.name }}</td>
                    <td>{{ book.author_name}}</td>
                    <td>{{ book.borrow_time }}</td>
                    <td>
                        {% if book.is_return ==0 %}
                            <span class="text-danger">未归还</span>
                        {% else %}
                            <span class="text-success">已归还</span>
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
          </tbody>
    </table>
    </div>
{% endblock %}